#ifndef USERLIST_H
#define USERLIST_H

#include <QAbstractListModel>
#include "User.h"

class UserList : public QAbstractListModel
{
    Q_OBJECT
public:
    explicit UserList(QObject *parent = 0);

	QVariant data(const QModelIndex &index, int role) const;
	int rowCount(const QModelIndex &parent) const;

	Qt::ItemFlags flags(const QModelIndex &index) const;
	bool setData(const QModelIndex &index, const QVariant &value,
				 int role = Qt::EditRole);

	bool insertRow(int row, const QModelIndex &parent);
	bool removeRow(int row, const QModelIndex &parent);

	// usermade :)
	void addOrReplace(User *u);
	QString getNameById(int id);
	void removeRowById(int id);

	void clear();

private:
	QList<User *> *users;

signals:

public slots:

};

#endif // USERLIST_H
